package com.example.myapplication.model;

import android.os.Message;
import android.util.Log;
import android.widget.ImageView;
import android.widget.TextView;

import com.mysql.cj.MysqlConnection;

import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.ProtocolException;
import java.net.URL;
import java.sql.Statement;

public class MainModel extends MysqlJDBCUtil {
    public void setTabInfo(TextView tv, int color, ImageView iv, int id, MainCallBack cb) {
//        Statement st=connectDb();
        try {
            cb.success(tv, color, iv, id);
        } catch (
                Exception e) {
            e.printStackTrace();
            cb.fail("获取数据失败！");
        }
    }

    public interface MainCallBack {
        void success(TextView tv, int color, ImageView iv, int id);

        void fail(String err);
    }
}
